﻿<?php
 if (isset($_POST['submit'])) {


	$name  = isset($_POST['name'])  ? trim($_POST['name'])  : '';
	$email = isset($_POST['email']) ? trim($_POST['email']) : '';
	$title = isset($_POST['title']) ? trim($_POST['title']) : '';
	$message  = isset($_POST['message'])  ? trim($_POST['message'])  : '';
  $reason = isset($_POST['reason'])  ? trim($_POST['reason'])  : '';

  $to = 'mtalha.khan@live.com,zain.shaikh@msn.com,fasih_hansmukh@yahoo.com,fasihhansmukh99@hotmail.com';
  
	$subject = 'Pixcile.com - New Contact : ' . $title;

  $body = '
  <html>
  <head>
    <title>Email message</title>
  </head>
  <body>';
	$body .= 'Name : ' . $name;
	$body .= '<br />';
	$body .= 'Email : ' . $email;
	$body .= '<br />';
	$body .= 'Title : ' . $title;
	$body .= '<br />';
  $body .= 'Reason : ' . $reason;
	$body .= '<br />';
	$body .= 'Message : ' . $message;
	$body .= '<br />';
  $body .= '</body>
  </html>
  ';
  
  // optional headerfields 
  $headers  = 'MIME-Version: 1.0' . "\r\n";
  $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  $headers .= "From: ". $name . " <" . $email . ">"; // . "\r\n"; 
  

  ini_set('sendmail_from', 'contact@pixcile.com'); 

	if (mail($to,  $subject, $body, $headers)) {
		echo("ok");
	} else {
		echo("error");
	}

}

?>